import { createVNode, render, type App } from "vue";
import { rem } from "./pxtovw";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
const fn = () => "鱼钓猫的小鱼干";

export default {
  install(app: App) {
    app.config.globalProperties.$env = "dev";
    app.config.globalProperties.$fishingcat = fn;
    app.config.globalProperties.$rem = rem;

    // 图标注册
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};

declare module "@vue/runtime-core" {
  export interface ComponentCustomProperties {
    $env: string;
    $fishingcat: () => string;
    $rem: (v: number) => number;
  }
}
